package router

import (
	"math/rand/v2"
	"strings"
)

func validatePath(path string) {

	switch {
	case len(path) == 0 || !strings.HasPrefix(path, "/"):
		panic("path must begin with '/' in path '" + path + "'")
	}

}

func bytesRand(dst []byte) []byte {

	size := len(dst)
	for i := 0; i < size; i++ {
		dst[i] = rand.N[byte](0xFF)
	}
	return dst

}
